// 启用路由
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

// 引入页面
import index from '@pages/index'
import login from '@pages/login'
import register from '@pages/register'
import admin from '@pages/admin'
import home from '@pages/home'
import incspe from '@pages/incspe'
import dayDetails from '@pages/day-details'
import monthDetails from '@pages/month-details'
import myMoney from '@pages/my-money'
import incomeList from '@pages/income-list'
import typeList from '@pages/type-list'

// 路由配置
const config = [
      {
            path: '/',
            component: index
      },
      {
            path: '/index',
            component: index
      },
      {
            path: '/login',
            component: login
      },
      {
            path: '/register',
            component: register
      },
      {
            path: '/admin',
            component: admin
      },
      {
            path: '/home',
            component: home
      },
      {
            path: '/incspe/:isincspe',
            component: incspe
      },
      {
            path: '/day-details',
            component: dayDetails
      },
      {
            path: '/month-details',
            component: monthDetails
      },
      {
            path: '/my-money',
            component: myMoney
      },
      {
            path: '/income-list',
            component: incomeList
      },
      {
            path: '/type-list',
            component: typeList
      }
]

// 实例化路由
const router = new Router({
      routes: config,

      // URL去除#(路由刷新或直接访问某个地址时会有问题)
      // mode: 'history',

      // router-link 当前class
      linkActiveClass: 'active',
})

// 导出路由
export default router
